package tasks

import akka.actor.{ActorSystem, Props}
import javax.inject.Inject

import scala.concurrent.ExecutionContext
import com.typesafe.akka.extension.quartz.QuartzSchedulerExtension

class QuartzSchedulerTask@Inject()(actorSystem: ActorSystem,dynamicJobSchedule: DynamicJobSchedule)(implicit executionContext: ExecutionContext){

  /**
   * JobSchedules
   */
  dynamicJobSchedule.loadJobs()

  val cleaner = actorSystem.actorOf(Props(new HelloActor))

  //QuartzSchedulerExtension(actorSystem).schedule("cronEveryEvenSecond", cleaner, "2s")
  //QuartzSchedulerExtension(actorSystem).schedule("cronEvery30Seconds",cleaner,"30s")

}

